    </tbody>
  </table>
</div>

<script>
  const path = getPath();
  const path_div = document.getElementById("path")
  path_div.innerText = path;
  path_div.addEventListener("click", () => {
    alert(`Current Path is: ${path}`);
  })

  if (path !== "/") {
    const pathSegments = path.split("/");
    pathSegments.pop();
    const currentPath = (
      "/" +
      pathSegments.filter((segment) => segment).join("/") +
      "/"
    ).replace(/\/+/g, "/");
    pathSegments.pop();
    const parentPath = (
      "/" +
      pathSegments.filter((segment) => segment).join("/") +
      "/"
    ).replace(/\/+/g, "/");

    const upload_button = document.getElementById("upload-button");
    upload_button.href =
      "/upload.html#" + encodeURIComponent(currentPath || "/");
  } else {
    document.getElementById("parent-path-table-row").style = "display: none;";
  }

  document.getElementById('file-list').addEventListener('click', function (event) {
    if (event.target.classList.contains('deleteButton')) {
      const filepath = event.target.getAttribute('filepath');
      if (filepath) {
          deleteFile(filepath);
      }
    }
  });
</script>
